<html>
<head>
	<meta charset="utf-8">
	<title>用户登录 — 昊美科技CRM系统</title>
	<base href="<?=base_url()?>" />
	<script language="JavaScript" type="text/javascript" src="js/jquery.js"></script>
	<style type=text/css>
		body {text-align:center; font-family:"微软雅黑",arial; margin:0; padding:0; font-size:12px; color:#333; background-color:#fff;}
		div,form,img,ul,ol,li,dl,dt,dd {margin:0; padding:0; border:0;}
		h1,h2,h3,h4,h5,h6,p{margin:0; padding:0;}
		table,td,tr,th{font-size:12px;}
		ul{list-style:none;}
		.left{float:left; _display:inline;}
		.right{float:right; _display:inline;}
		a{color:#333; text-decoration:none; behavior:url(js/link_no_bord.htc);}
		a:hover{ color:#630; text-decoration:underline;}



		.clear{font:0/0 sans-serif; height:0; overflow:hidden; clear:both; display:block;}
		.clearfix:after{content:"."; display:block; height:0; clear:both; visibility:hidden;}
		.clearfix{display:inline-table;}
		/* Hides from IE-mac \*/
		* html .clearfix{height:1%;}
		*+html .clearfix{height:1%;}
		.clearfix{display:block;}
		/* End hide from IE-mac */
	  	.login_cont{ width:1000px; background:url(images/login_ng.jpg) no-repeat; padding-top:35px; height:570px; margin:auto;}
		.login_cont_left{ float:left; margin-left:40px;}
		.login_cont_right{ float:right; width:350px; padding-top:145px; padding-right:70px;}
		.cont_right_c{ width:347px; height:337px; background:url(images/login_11.jpg) no-repeat; padding-top:135px; overflow:hidden; margin:auto;}
		.cont_right_c table.one_tab{ width:347px; text-align:center;}
		.cont_right_c table.one_tab tr{ text-align:left; line-height:50px;}
		.cont_right_c table.one_tab tr th{ text-align:right; color:#666; font-family:"微软雅黑"}
		.cont_right_c table.one_tab tr td{ text-align:left;}
		.cont_right_c .text{ background:url(images/input_bg.jpg) left top no-repeat; width:145px; height:29px; line-height:29px; border:none; padding-left:10px;
		color:#666; font-weight:normal;}
		.cont_right_c .pasd{ background:url(images/input_bg.jpg) left top no-repeat; width:145px; height:29px; line-height:29px; border:none; padding-left:10px; color:#666;}
		.cont_right_c table.two_tab{ text-align:center; width:353px; margin-top:28px; margin-left:3px;}
		.cont_right_c table.two_tab td{ text-align:center;}
		.butt_one{ background:url(images/q.jpg) no-repeat; width:104px; height:41px; border:none; cursor:pointer;}
		.butt_two{ background:url(images/qx.jpg) no-repeat; width:104px; height:41px; border:none; cursor:pointer;}
		.butt{ width:347px;}
		.butt ul{ width:347px; margin:auto;}
		.butt ul li{ width:105px; float:left; margin:auto;}
	</style>
</head>
<body>
<form action="index.php/login/check_login" method="post">
    <div class="login_cont">
        <div class="login_cont_left"><img src="images/login_logo.jpg"></div>
    <div class="login_cont_right">
            <div class="cont_right_c">
            	<table class="one_tab">
               	  <tr><th>USER NAME：</th><td><input type="text" class="text" id="name" name="name" value="" onClick="this.value=''"></input><span id="name_error"></span></td></tr>
                  <tr><th>PASSWORD：</th><td><input type="password" class="pasd" id="pswd" name="pswd" value="" onClick="this.value=''"></input><span id="pswd_error"></span></td></tr>
                </table>
                <table class="two_tab">
                	<tr><td>&nbsp;</td><td><input type="submit" value="" class="butt_one"/></td><td><input type="button" value="" id="qingchu" class="butt_two"/></td><td>&nbsp;</td><td>&nbsp;</td></tr>
                </table>
            </div>
        </div>
    </div>
</form>
<input type="hidden" id="login_fail" value="<?php echo $login_fail;?>"/>
<script language="JavaScript" type="text/javascript">
		$(function(){
			$(".butt_one").click(function(){
				var username=$.trim($(".text").val());
				var pswd = $.trim($(".pasd").val());
				var n=0;
				if(username != ''){
					n=n+1;
				}else{
					$("#name_error").html('');
					$("#name_error").append('<a href="javascript:void (0)" title="用户名错误"><image src="images/error.gif"/></a>');
					$("#name").focus();
				}
				if(pswd.length > 5){
					n=n+1;
				}else{
					$("#pswd_error").html('');
					$("#pswd_error").append('<a href="javascript:void (0)" title="密码不能小于6位"><image src="images/error.gif"/></a>');
					$("#pswd").focus();
					if($("#name").val() == '' && $("#pswd").val() == ''){
						$("#name").focus();
						}
				}
				if(n == 2){
					return true;
				}else{
					return false;
				}
			})
			$("#qingchu").click(function(){
				$(".text").val('');
				$(".pasd").val('');
			})

			if($("#login_fail").val()){
				   alert('登陆失败,请检查用户名/密码');
				   $(".text").focus();
			}
		})
</script>
</body>
</html>